package com.akupilih.app.adapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.akupilih.app.StempFragment;
import com.akupilih.app.VoteChartFragment;

public class VoteAdapter extends FragmentPagerAdapter {

	final int PAGE_COUNT = 2;
	private final String[] TITLES = { "Avatar", "Hasil Vote" };

    public VoteAdapter(FragmentManager fragmentManager) {
		super(fragmentManager);
		// TODO Auto-generated constructor stub
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return PAGE_COUNT;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		// TODO Auto-generated method stub
		return TITLES[position];
	}

	@Override
	public Fragment getItem(int arg0) {
		Bundle data = new Bundle();
		switch (arg0) {

		/** tab1 is selected */
		case 0:
			StempFragment fragment1 = new StempFragment();
			return fragment1;

			/** tab2 is selected */
		case 1:
			VoteChartFragment fragment2 = new VoteChartFragment();
			return fragment2;
		}
		return null;
	}

}
